#include <string.h>
#include <iostream>
using std::cout;
using std::endl;

//类名命名遵循驼峰规则
class Computer{
public:
    //成员函数命名遵循小驼峰规则
    void setBrand(const char * brand){
        strcpy(_brand,brand);
    }

    void setPrice(double price){
        _price = price;
    }

    void print(){
        cout << "brand:" << _brand << endl
            << "price:" << _price << endl;
    }
private:
    //数据成员命名以_开头
    char _brand[20];
    double _price;
};//大括号中称为类内部，大括号外称为类外部

void test0(){
    int a;
    Computer pc;
    pc.setBrand("HuaWei");
    pc.setPrice(19999);
    pc.print();
    /* pc._price = 3000;//体现了封装性 */
}

int main(void){
    test0();
    return 0;
}
